package com.ruirenyun.util.annotation.validator;

import com.ruirenyun.util.common.PersonIdCardUtil;
import org.springframework.validation.annotation.Validated;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * @author Deng Ye
 * @version 1.0
 * @description
 * @date 2021/3/15 15:23
 */
@Validated
public class IdCardNumberValidator implements ConstraintValidator<IdCardNumber, String> {
    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        return PersonIdCardUtil.isValidatedAllIdcard(value);
    }
}
